import 'package:flutter/material.dart';

import '../models.dart';

class Stat extends StatelessWidget {
  final AppState appState;
  const Stat({super.key, required this.appState});
  get completeTodosCount =>
      appState.todos.where((todo) => todo.complete).length;
  get activeTodosCount => appState.todos.where((todo) => !todo.complete).length;
  @override
  Widget build(BuildContext context) {
    return Center(
      child: Column(
        mainAxisAlignment: MainAxisAlignment.center,
        children: [
          Text('Complete'),
          Text('$completeTodosCount'),
          Text('Active'),
          Text('$activeTodosCount'),
        ],
      ),
    );
  }
}
